﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using FanaticRock.Core.ServiceInterfaces;

namespace FanaticRock.Core.Helpers
{
    public static class AssemblyHelper
    {
        public const string ProjectName = "FanaticRock";

        public static IEnumerable<Assembly> GetCurrentAssemblies()
        {
            return AppDomain.CurrentDomain.GetAssemblies();
        }

        public static IEnumerable<Assembly> GetThisProjectAssemblies()
        {
            var allAssemblies = GetCurrentAssemblies();
      
            foreach (var assembly in allAssemblies)
            {
               var name = assembly.GetName().Name;
                if (name.StartsWith(ProjectName))
                {
                    yield return assembly;
                }
            }
         
        }
    }
}
